﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>图表</title>
<!-- Bootstrap Styles-->
<link href="assets/css/bootstrap.css" rel="stylesheet" />
 <!-- FontAwesome Styles-->
<link href="assets/css/font-awesome.css" rel="stylesheet" />
 <!-- Morris Chart Styles-->
<link href="assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
	<!-- Custom Styles-->
<link href="assets/css/custom-styles.css" rel="stylesheet" />
 <!-- Google Fonts-->
<link href='http://fonts.useso.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
<div id="wrapper">
	<nav class="navbar navbar-default top-navbar" role="navigation">
		<div class="navbar-header">
			<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
				<span class="sr-only">Bar</span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
				<span class="icon-bar"></span>
			</button>
			<a class="navbar-brand" href="index.php"><strong>WifiObject</strong></a>
		</div>

		<ul class="nav navbar-top-links navbar-right">
			<li class="dropdown">
				<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
					<i class="fa fa-envelope fa-fw"></i> <i class="fa fa-caret-down"></i>
				</a>
				<ul class="dropdown-menu dropdown-messages">
					<li>
						<a href="#">
							<div>
								<strong>John Doe</strong>
								<span class="pull-right text-muted">
									<em>Today</em>
								</span>
							</div>
							<div>Lorem Ipsum has been the industry's standard dummy text ever since the 1500s...</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a href="#">
							<div>
								<strong>John Smith</strong>
								<span class="pull-right text-muted">
									<em>Yesterday</em>
								</span>
							</div>
							<div>Lorem Ipsum has been the industry's standard dummy text ever since an kwilnw...</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a href="#">
							<div>
								<strong>John Smith</strong>
								<span class="pull-right text-muted">
									<em>Yesterday</em>
								</span>
							</div>
							<div>Lorem Ipsum has been the industry's standard dummy text ever since the...</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a class="text-center" href="#">
							<strong>Read All Messages</strong>
							<i class="fa fa-angle-right"></i>
						</a>
					</li>
				</ul>
				<!-- /.dropdown-messages -->
			</li>
			<!-- /.dropdown -->
			<li class="dropdown">
				<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
					<i class="fa fa-tasks fa-fw"></i> <i class="fa fa-caret-down"></i>
				</a>
				<ul class="dropdown-menu dropdown-tasks">
					<li>
						<a href="#">
							<div>
								<p>
									<strong>Task 1</strong>
									<span class="pull-right text-muted">60% Complete</span>
								</p>
								<div class="progress progress-striped active">
									<div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
										<span class="sr-only">60% Complete (success)</span>
									</div>
								</div>
							</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a href="#">
							<div>
								<p>
									<strong>Task 2</strong>
									<span class="pull-right text-muted">28% Complete</span>
								</p>
								<div class="progress progress-striped active">
									<div class="progress-bar progress-bar-info" role="progressbar" aria-valuenow="28" aria-valuemin="0" aria-valuemax="100" style="width: 28%">
										<span class="sr-only">28% Complete</span>
									</div>
								</div>
							</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a href="#">
							<div>
								<p>
									<strong>Task 3</strong>
									<span class="pull-right text-muted">60% Complete</span>
								</p>
								<div class="progress progress-striped active">
									<div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%">
										<span class="sr-only">60% Complete (warning)</span>
									</div>
								</div>
							</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a href="#">
							<div>
								<p>
									<strong>Task 4</strong>
									<span class="pull-right text-muted">85% Complete</span>
								</p>
								<div class="progress progress-striped active">
									<div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="85" aria-valuemin="0" aria-valuemax="100" style="width: 85%">
										<span class="sr-only">85% Complete (danger)</span>
									</div>
								</div>
							</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a class="text-center" href="#">
							<strong>See All Tasks</strong>
							<i class="fa fa-angle-right"></i>
						</a>
					</li>
				</ul>
				<!-- /.dropdown-tasks -->
			</li>
			<!-- /.dropdown -->
			<li class="dropdown">
				<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
					<i class="fa fa-bell fa-fw"></i> <i class="fa fa-caret-down"></i>
				</a>
				<ul class="dropdown-menu dropdown-alerts">
					<li>
						<a href="#">
							<div>
								<i class="fa fa-comment fa-fw"></i> New Comment
								<span class="pull-right text-muted small">4 min</span>
							</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a href="#">
							<div>
								<i class="fa fa-twitter fa-fw"></i> 3 New Followers
								<span class="pull-right text-muted small">12 min</span>
							</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a href="#">
							<div>
								<i class="fa fa-envelope fa-fw"></i> Message Sent
								<span class="pull-right text-muted small">4 min</span>
							</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a href="#">
							<div>
								<i class="fa fa-tasks fa-fw"></i> New Task
								<span class="pull-right text-muted small">4 min</span>
							</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a href="#">
							<div>
								<i class="fa fa-upload fa-fw"></i> Server Rebooted
								<span class="pull-right text-muted small">4 min</span>
							</div>
						</a>
					</li>
					<li class="divider"></li>
					<li>
						<a class="text-center" href="#">
							<strong>See All Alerts</strong>
							<i class="fa fa-angle-right"></i>
						</a>
					</li>
				</ul>
				<!-- /.dropdown-alerts -->
			</li>
			<!-- /.dropdown -->
			<li class="dropdown">
				<a class="dropdown-toggle" data-toggle="dropdown" href="#" aria-expanded="false">
					<i class="fa fa-user fa-fw"></i> <i class="fa fa-caret-down"></i>
				</a>
				<ul class="dropdown-menu dropdown-user">
					<li><a href="#"><i class="fa fa-user fa-fw"></i> User Profile</a>
					</li>
					<li><a href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
					</li>
					<li class="divider"></li>
					<li><a href="#"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
					</li>
				</ul>
				<!-- /.dropdown-user -->
			</li>
			<!-- /.dropdown -->
		</ul>
	</nav>
	<!--/. NAV TOP  -->
	<nav class="navbar-default navbar-side" role="navigation">
		<div class="sidebar-collapse">
			<ul class="nav" id="main-menu">

				<li>
					<a href="index.php"><i class="fa fa-dashboard"></i> 概览</a>
				</li>
				<li>
					<a href="chart.php" class="active-menu"><i class="fa fa-bar-chart-o"></i> 图表</a>
				</li>
				<li>
					<a href="table.php"><i class="fa fa-table"></i> 源数据表</a>
				</li>
				<li>
					<a href="#"><i class="fa fa-sitemap"></i> 其他设备<span class="fa arrow"></span></a>
					<ul class="nav nav-second-level">
						<li>
							<a href="#">#1</a>
						</li>
						<li>
							<a href="#">#2</a>
						</li>
						<li>
							<a href="#">#3</a>

						</li>
					</ul>
				</li>
				<li>
					<a href="empty.php"><i class="fa fa-fw fa-file"></i> 更多</a>
				</li>
			</ul>

		</div>

	</nav>
	<!-- /. NAV SIDE  -->
	<div id="page-wrapper">
	  <div class="header"> 
					<h1 class="page-header">
						 图表 <small>查看数据统计分析结果</small>
					</h1>
					<ol class="breadcrumb">
				  <li><a href="#">Home</a></li>
				  <li><a href="#">图表</a></li>
				  <li class="active">车棚</li>
				</ol> 
								
	</div>
		<div id="page-inner"> 
		 
			<div class="row"> 
				
				  
			   <div class="col-md-5">                     
				<div class="panel panel-default">
					<div class="panel-heading">
						常客占比
					</div>
					<div class="panel-body">
						<div id="morris-bar-chart"><canvas id="PieChart" height="288"></canvas></div>
					</div>
				</div>            
			</div>
				  <div class="col-md-7">                     
				<div class="panel panel-default">
					<div class="panel-heading">
						本周内人流量
					</div>
					<div class="panel-body">
						<div id="morris-area-chart"><canvas id="theBarChart" height="200"></canvas></div>
					</div>
				</div>            
			</div> 
			
	   </div>
			 <!-- /. ROW  -->
			<div class="row">                     
				  
			   <div class="col-md-12 col-sm-12 col-xs-12">                     
				<div class="panel panel-default">
					<div class="panel-heading">
						一天内数据变化
					</div>
					<div class="panel-body">
						<div id="line-chart"><canvas id="LineChart" height="100"></canvas></div>
					</div>
				</div>            
			</div>
	   </div>
			 <!-- /. ROW  -->
			<div class="row">                     
				  
			   <div class="col-md-6 col-sm-12 col-xs-12">       
				<div class="panel panel-default">
					<div class="panel-heading">
						前一天数据变化
					</div>
					<div class="panel-body">
						<div id="yestoday-line-chart"><canvas id="YestodayLineChart" height="100"></canvas></div>
					</div>
				</div>            
			</div>
			   <div class="col-md-6 col-sm-12 col-xs-12">       
				<div class="panel panel-default">
					<div class="panel-heading">
						上一周人流量
					</div>
					<div class="panel-body">
						<div id="yestoday-line-chart"><canvas id="l_theBarChart" height="100"></canvas></div>
					</div>
				</div>            
			</div>
	   </div>
			 <!-- /. ROW  -->
			 <footer>
			 <center>
			 <p>Copyright &copy; 2017.Company name All rights reserved.<a target="_blank" href="./index.php">关于我们</a></p>
			 </center>
			 </footer>
			</div>
		 <!-- /. PAGE INNER  -->
		</div>
	 <!-- /. PAGE WRAPPER  -->
	</div>
 <!-- /. WRAPPER  -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="assets/js/jquery-1.10.2.js"></script>
  <!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
<!-- Metis Menu Js -->
<script src="assets/js/jquery.metisMenu.js"></script>
 <!-- Morris Chart Js -->
 <script src="assets/js/morris/raphael-2.1.0.min.js"></script>
<script src="assets/js/morris/morris.js"></script>
<script src="assets/js/Chart.js"></script>
  <!-- Custom Js -->
<script src="assets/js/custom-scripts.js"></script>
<?php require_once "tableData.php"; ?>
      <script>
var ctx = document.getElementById("PieChart");
var PieChart = new Chart(ctx, {
    type: 'doughnut',
    data: {
        labels: ['常客', '普通客人'],
        datasets: [{
            label: '常客占比',
            data: [<?php echo $offen.','.($sumMonth-$offen); ?>],
            backgroundColor: [
                'rgba(54, 162, 235, 0.2)',
                'rgba(153, 102, 180, 0.2)'
            ],
            borderColor: [
                'rgba(54, 162, 235, 1)',
                'rgba(153, 102, 180, 1)'
            ],
            borderWidth: 1
        }]
    },
    options: {
    }
});
      </script>
      <script>
var ctx = document.getElementById("theBarChart");
var theBarChart = new Chart(ctx, {
    type: 'bar',
    data: {
        labels: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
        datasets: [{
            label: '一周内',
            data: [<?php echo $Mon.','.$Tue.','.$Wed.','.$Thu.','.$Fri.','.$Sat.','.$Sun; ?>],
            backgroundColor: [
                'rgba(255, 99, 132, 0.2)',
                'rgba(54, 162, 235, 0.2)',
                'rgba(255, 206, 86, 0.2)',
                'rgba(75, 192, 192, 0.2)',
                'rgba(153, 102, 255, 0.2)',
                'rgba(255, 159, 64, 0.2)',
                'rgba(153, 102, 180, 0.2)'
            ],
            borderColor: [
                'rgba(255,99,132,1)',
                'rgba(54, 162, 235, 1)',
                'rgba(255, 206, 86, 1)',
                'rgba(75, 192, 192, 1)',
                'rgba(153, 102, 255, 1)',
                'rgba(255, 159, 64, 1)',
                'rgba(153, 102, 180, 1)'
            ],
            borderWidth: 1
        }]
    },
    options: {
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero:true
                }
            }]
        }
    }
});
</script>
      <script>
var ctx = document.getElementById("LineChart");
var LineChart = new Chart(ctx, {
    type: 'line',
    data: {
labels: ["7:00-8:00", "8:00-9:00", "9:00-10:00", "10:00-11:00", "11:00-12:00", "12:00-13:00", "13:00-14:00", "14:00-15:00", "15:00-16:00", "16:00-17:00", "17:00-18:00", "18:00-19:00", "19:00-20:00"],
        datasets: [{
            label: '一天内',
            data: [<?php echo $qi.','.$ba.','.$jiu.','.$shi.','.$shiyi.','.$shier.','.$shisan.','.$shisi.','.$shiwu.','.$shiliu.','.$shiqi.','.$shiba.','.$shijiu.','.$ershi; ?>],
            backgroundColor: [
                'rgba(54, 162, 235, 0.2)'
            ],
            borderColor: [
                'rgba(54, 162, 235, 1)'
            ],
            borderWidth: 1,
            pointBackgroundColor: [
                'rgba(54, 162, 235, 0.2)'
            ],
            pointBorderColor: [
                'rgba(54, 162, 235, 1)'
            ],
        }]
    },
    options: {
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero:true
                }
            }]
        }
    }
});
</script>
      <script>
var ctx = document.getElementById("YestodayLineChart");
var LineChart = new Chart(ctx, {
    type: 'line',
    data: {
labels: ["7:00-8:00", "8:00-9:00", "9:00-10:00", "10:00-11:00", "11:00-12:00", "12:00-13:00", "13:00-14:00", "14:00-15:00", "15:00-16:00", "16:00-17:00", "17:00-18:00", "18:00-19:00", "19:00-20:00"],
        datasets: [{
            label: '昨天',
            data: [<?php echo $l_qi.','.$l_ba.','.$l_jiu.','.$l_shi.','.$l_shiyi.','.$l_shier.','.$l_shisan.','.$l_shisi.','.$l_shiwu.','.$l_shiliu.','.$l_shiqi.','.$l_shiba.','.$l_shijiu; ?>],
            backgroundColor: [
                'rgba(54, 162, 235, 0.2)'
            ],
            borderColor: [
                'rgba(54, 162, 235, 1)'
            ],
            borderWidth: 1,
            pointBackgroundColor: [
                'rgba(54, 162, 235, 0.2)'
            ],
            pointBorderColor: [
                'rgba(54, 162, 235, 1)'
            ],
        }]
    },
    options: {
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero:true
                }
            }]
        }
    }
});
</script>
      <script>
var ctx = document.getElementById("l_theBarChart");
var theBarChart = new Chart(ctx, {
    type: 'bar',
    data: {
        labels: ["周一", "周二", "周三", "周四", "周五", "周六", "周日"],
        datasets: [{
            label: '一周内',
            data: [<?php echo $l_Mon.','.$l_Tue.','.$l_Wed.','.$l_Thu.','.$l_Fri.','.$l_Sat.','.$l_Sun; ?>],
            backgroundColor: [
                'rgba(255, 99, 132, 0.2)',
                'rgba(54, 162, 235, 0.2)',
                'rgba(255, 206, 86, 0.2)',
                'rgba(75, 192, 192, 0.2)',
                'rgba(153, 102, 255, 0.2)',
                'rgba(255, 159, 64, 0.2)',
                'rgba(153, 102, 180, 0.2)'
            ],
            borderColor: [
                'rgba(255,99,132,1)',
                'rgba(54, 162, 235, 1)',
                'rgba(255, 206, 86, 1)',
                'rgba(75, 192, 192, 1)',
                'rgba(153, 102, 255, 1)',
                'rgba(255, 159, 64, 1)',
                'rgba(153, 102, 180, 1)'
            ],
            borderWidth: 1
        }]
    },
    options: {
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero:true
                }
            }]
        }
    }
});
</script>

</body>
</html>
